﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvironmentManagerSystem.MODE;
using Maticsoft.DBUtility;
using System.Data;

namespace EnvironmentManagerSystem.BLL
{
    public class ExpertIndustryKindOne
    {
        public static ExpertIndustryKindOneDataList GetList()
        {
            try
            {
                ExpertIndustryKindOneDataList lst = new ExpertIndustryKindOneDataList();
                StringBuilder br = new StringBuilder();
                br.Append(" select ");
                br.Append(" tbs001_expertindustrykindone.id, ");
                br.Append(" tbs001_expertindustrykindone.ExpertIndustryKindOneCode, ");
                br.Append(" tbs001_expertindustrykindone.ExpertIndustryKindOneName  ");
                br.Append(" from tbs001_expertindustrykindone");

                DataTable dt = DbHelperMySQL.Query(br.ToString()).Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ExpertIndustryKindOneData model = new ExpertIndustryKindOneData();
                    model.ID = Convert.ToInt32(dt.Rows[i].ItemArray[0]);
                    model.ExpertIndustryKindOneCode = dt.Rows[i].ItemArray[1].ToString();
                    model.ExpertIndustryKindOneName = dt.Rows[i].ItemArray[2].ToString();

                    lst.Add(model);
                }
                return lst;
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(ex.Message);
                return null;
            }
        }
    }
}
